﻿@model IEnumerable<Ja.Mvc.Acdf.Models.GetSubCategoryPhotoViewModel>

@{
    ViewBag.Title = "Sub Categories";
}

<h2>@ViewBag.Title</h2>
<div>
    <span class="btn btn-default">@Html.ActionLink("Back to Categories", "Category")</span>
</div>

@*http://stackoverflow.com/questions/15357468/c-sharp-foreach-within-foreach-display-3-item-in-each-item-carousel*@

<!-- container -->
<div class="container">
    @foreach (var group in Model.Select((x, index) => new { element = x, index }).GroupBy(x => x.index / 2, x => x.element))
    {
        <div class="col-sm-6 col-md-4">
            @foreach (var well in group)
            {
                <div class="thumbnail">
                    <a href="GetPhotos?categoryID=@well.CategoryId&subCategoryID=@well.SubCategoryId" class=" btn btn-default btn-block"> @well.SubCategoryName </a>
                </div>
            }
        </div>
    }
</div><!-- container -->

<div>
    <span class="btn btn-default">@Html.ActionLink("Back to Categories", "Category")</span>
</div>
